package com.ssyc.gsk_teacher_appraisal.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.ssyc.common.adapter.CommonAdapter;
import com.ssyc.common.adapter.ViewHolder;
import com.ssyc.gsk_teacher_appraisal.R;
import com.ssyc.gsk_teacher_appraisal.bean.PieInfo;

import java.util.List;

/**
 * 展示饼状图标签的列表数据模型
 * Created by Administrator on 2018/11/1 0001.
 */

public class PieLvAdapter extends CommonAdapter<PieInfo> {

    public PieLvAdapter(Context context, List<PieInfo> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, PieInfo pieInfo) {
        //设置标签颜色
        View viewFlag = holder.getView(R.id.view_flag);
        viewFlag.setBackgroundColor(pieInfo.colorId);

        //设置标签名称
        TextView tvLable = holder.getView(R.id.tv_lable);
        tvLable.setText(pieInfo.lable);
    }
}
